import {Menu, Perm} from "@/services";
import {EntityId, PageQueryParams} from "kf-web-library";

export interface RolePageQueryParams extends Partial<PageQueryParams> {
  searchText?: string;
  ids?: EntityId[];
  codes?: EntityId[];
}

export interface Role {
  id: EntityId;
  code: string;
  name: string;
  createTime?: string;
  modifyTime?: string;
  description?: string;
  perms?: Perm[];
  menus?: Menu[];
}

export interface Role_Create {
  code: string;
  name: string;
  description?: string;
  permIds?: number[];
  menuIds?: number[];
}

export interface Role_Modify extends Role_Create {
  id: EntityId;
}

export interface Role_Patch extends Partial<Role_Modify> {
  id: EntityId;
}

